import axios from './axios'
// 开始抽奖
export function luckyDraw(data) {
  return axios(`/draw/ydDrawHistory/draw`, {
      method: 'post',
      data:data 
  })
}
// 查询用户次数
export function DrawNums(data) {
  return axios(`/draw/ydDrawHistory/drawTimes`, {
      method: 'post',
      data:data
  })
}
// 查询活动规则
export function activityRules(current) {
  let query = ''
  for (let key in current) {
      query += `${key}=${current[key]}&`
  }
  if (query) {
      query = '?' + query
  }
  return axios(`/code/rule/list${query}`, {
      method: 'get',
  })
}
//查询奖品配置列表
export function actList(data) {
  return axios(`/draw/actItem/actList`, {
      method: 'post',
      data:data
  })
}

// 中奖记录
export function historyList(current) {
  let query = ''
  for (let key in current) {
      query += `${key}=${current[key]}&`
  }
  if (query) {
      query = '?' + query
  }
  return axios(`/draw/ydDrawHistory/list${query}`, {
      method: 'get',
  })
}
// 新增意见
export function newSuggestion(data) {
  return axios(`/code/suggestion`, {
      method: 'post',
      data:data
  })
}
// 立即兑换
export function exchangePrize(data) {
  return axios(`/draw/ydDrawHistory/prize`, {
      method: 'post',
      data:data
  })
}
